home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group93b.txt / 000100_icon-group-sender _Mon May 17 08:41:30 1993.msg < prev    next >
Internet Message Format  |  1993-06-16  |  3KB

  1. Received: from owl.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 17 May 1993 09:19:07 MST
  2. Received: by owl.cs.arizona.edu; Mon, 17 May 1993 09:19:06 MST
  3. Message-Id: <9305171538.AA58087@enlil.premenos.sf.ca.us>
  4. From: Ken Walker <kwalker@shara.premenos.sf.ca.us>
  5. Subject: Re: Icon vs Prolog, docs, availability ?
  6. To: icon-group@cs.arizona.edu
  7. Date: Mon, 17 May 93 8:41:30 PDT
  8. In-Reply-To: <borbor-130593120939@129.194.82.105>; from "Boris Borcic" at May 13, 93 10:28 am
  9. Mailer: Elm [revision: 66.25]
  10. Status: R
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12.  
  13. > Boris Borcic <borbor@divsun.unige.ch> writes:
  14. > I have read in this group that Icon uses a backtracking
  15. > mechanism very similar to Prolog. Would a user of both
  16. > languages care to sketch Icon with Prolog as background ?
  17. > What are the most significant differences ?
  18.  
  19.   - Icon does not have unification or even tree pattern matching.
  20.     Tree and list processing can certainly be done, but some things
  21.     are far less elegant than in Prolog.
  22.  
  23.   - Icon is strongly oriented toward string manipulation; string
  24.     scanning is the most fully developed built-in facility that
  25.     uses backtracking.
  26.  
  27.   - In Prolog, data backtracking is an inescapable part of the language.
  28.     In Icon, there are two kinds of assignments, those that are undone
  29.     upon backtracking and those that are not. The latter are typically
  30.     used much more than the former; Icon programs are not declarative.
  31.  
  32.   - Icon has control structures that look similar to those of more
  33.     conventional programming langauges, but have somewhat different
  34.     semantics in that they use and control success and failure rather
  35.     than being driven by boolean values. Many of these control structure
  36.     lexically limit backtracking; there is nothing as messy as Prolog's
  37.     "cut".
  38.     
  39. > What typical problems are there, if any,
  40. > that are easy to solve in Icon but not in Prolog, and vice-versa ?
  41. > For instance, it is at times desirable to constrain the 
  42. > search for further solutions in a way that depends on the
  43. > solutions already found. IMHO, the declarative leaning of Prolog's
  44. > backtracking makes this difficult and unnatural to program.
  45. > Does Icon let me do this naturally ?
  46.  
  47. I never got to the point where I felt I could "think in Prolog", so
  48. I'm not sure I can make a fair comparison at this level. Prolog gives
  49. you a very simple, very high-level programming model. If your problem
  50. fits easily into that model, Prolog is beautiful to program in. How
  51. may problems fit the model may depend on how you are able to think
  52. about them (sorry if this is rather vague). Icon, on the other hand,
  53. has more features and as an imperative languages gives you more
  54. control and more flexibility. It might be interesting to look at
  55. specific problems.
  56.  
  57. Ken Walker, kwalker@premenos.sf.ca.us
  58.